Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ddl: reject alter auto_random_base on a non auto_random table (#17714) #17828

Merged
merged 2 commits into from
Jun 10, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jun 6, 2020

cherry-pick #17714 to release-4.0


What problem does this PR solve?

Issue Number: close #17713

Problem Summary:

What is changed and how it works?

Proposal: xxx

What's Changed:

  • Add a check on t.Meta().AutoRandomBits
  • Add a tiny test

How it Works:

Related changes

Check List

Tests

  • Unit test
  • Manual test (add detailed scripts or steps below)

Side effects

Release note

  • Disallow alter auto_random_base on a non-auto_random table.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 6, 2020

/run-all-tests

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@crazycs520
Copy link
Contributor

/run-all-tests

@tangenta
Copy link
Contributor

/run-integration-copr-test

[2020-06-08T02:19:21.320Z] 2020/06/08 10:19:21 2020/06/08 10:19:15 Test fail: Outputs are not matching.

[2020-06-08T02:19:21.320Z] Test case: sql/randgen/8_encrypt.sql

[2020-06-08T02:19:21.320Z] Statement: #813 -  SELECT SHA1( `col_smallint_key` ) AS field1, ENCODE( `col_bit_key`, `col_bit` ) AS field2 FROM `table1_int_autoinc` WHERE ! `col_float_key` /* QNO 815 CON_ID 152 */ ;

[2020-06-08T02:19:21.320Z] NoPushDown Output: 

[2020-06-08T02:19:21.320Z] field1	field2

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] WithPushDown Output: 

[2020-06-08T02:19:21.320Z] field1	field2

[2020-06-08T02:19:21.320Z] fcaf7c134f49c65f2c5765d81c181f3334cefe18	

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] NoPushDown Plan: 

[2020-06-08T02:19:21.320Z] id	estRows	task	access object	operator info

[2020-06-08T02:19:21.320Z] Projection_4	0.00	root		sha1(cast(push_down_test_db.table1_int_autoinc.col_smallint_key, var_string(20)))->Column#62, encode(cast(push_down_test_db.table1_int_autoinc.col_bit_key, var_string(20)), cast(push_down_test_db.table1_int_autoinc.col_bit, var_string(20)))->Column#63

[2020-06-08T02:19:21.320Z] └─TableReader_7	0.00	root		data:Selection_6

[2020-06-08T02:19:21.320Z]   └─Selection_6	0.00	cop[tikv]		not(istrue(push_down_test_db.table1_int_autoinc.col_float_key))

[2020-06-08T02:19:21.320Z]     └─TableFullScan_5	1.00	cop[tikv]	table:table1_int_autoinc	keep order:false, stats:pseudo

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] WithPushDown Plan: 

[2020-06-08T02:19:21.320Z] id	estRows	task	access object	operator info

[2020-06-08T02:19:21.320Z] Projection_4	20.00	root		sha1(cast(push_down_test_db.table1_int_autoinc.col_smallint_key, var_string(20)))->Column#62, encode(cast(push_down_test_db.table1_int_autoinc.col_bit_key, var_string(20)), cast(push_down_test_db.table1_int_autoinc.col_bit, var_string(20)))->Column#63

[2020-06-08T02:19:21.320Z] └─IndexLookUp_10	20.00	root		

[2020-06-08T02:19:21.320Z]   ├─IndexRangeScan_8(Build)	20.00	cop[tikv]	table:table1_int_autoinc, index:col_float_key(col_float_key)	range:[NULL,NULL], [0,0], keep order:false, stats:pseudo

[2020-06-08T02:19:21.320Z]   └─TableRowIDScan_9(Probe)	20.00	cop[tikv]	table:table1_int_autoinc	keep order:false, stats:pseudo

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 

[2020-06-08T02:19:21.320Z] 2020/06/08 10:19:21 Test summary: non-matching queries: 1, success queries: 987, skipped queries: 13

@zimulala zimulala merged commit ef315c1 into pingcap:release-4.0 Jun 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution sig/sql-infra SIG: SQL Infra type/bugfix This PR fixes a bug. type/4.0-cherry-pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants